﻿using System.Web;
using System.Web.Mvc;
using DevFramework.Core.CrossCuttingConcern.ExceptionHandling.Exceptions;
using DevFramework.Business.Abstract;
using DevFramework.MvcUI.Infrastructure;
using DevFramework.Business.Abstract;

namespace DevFramework.MvcUI.Controllers
{
    public class HomeController : BaseController
    {
        private readonly IProductService _productService;
        private readonly ICategoryService _categoryService;

        public HomeController(IProductService productService , ICategoryService categoryService)
        {
            _productService = productService;
            _categoryService = categoryService;
        }

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Index(string mesaj)
        {
            throw new NotificationException("Mvc Exception");
            return View();
        }

        public ActionResult ChangeCulture(string dilId, string lang, string returnUrl)
        {
            Response.Cookies.Add(new HttpCookie("culture", lang));

            return Redirect(returnUrl);
        }
	}
}